package com.zmn.mcc.admin.controller.staff.log;


import com.zmn.base.common.data.dubbo.interfaces.company.CompanyListRemoteService;
import com.zmn.common.constant.GlobalConsts;
import com.zmn.mcc.admin.controller.MccBaseController;
import com.zmn.mcc.business.interfaces.staff.log.StaffLogBService;
import com.zmn.mcc.common.constant.DpermitConsts;
import com.zmn.mcc.model.entity.dept.McDept;
import com.zmn.mcc.model.entity.dept.McDeptQuery;
import com.zmn.mcc.services.interfaces.dept.DeptService;
import org.apache.dubbo.config.annotation.DubboReference;

import javax.annotation.Resource;
import java.util.List;

/**
 * 描述: 员工操作日志基础控制类
 *
 * @auther tanghongjun
 * @since 2019/7/23 16:35
 */
public class StaffLogBaseController extends MccBaseController {
    @Resource
    protected StaffLogBService staffLogBService;
    @DubboReference(version = com.zmn.base.plat.engine.common.constant.DubboConsts.INTERFACE_VERSION, check = false)
    protected CompanyListRemoteService companyListRemoteService;
    @Resource
    protected DeptService deptService;

    /**
     * 获取一级部门
     *
     * @return the one dept list
     */
    protected List<McDept> getOneDeptList() {
        McDeptQuery query = new McDeptQuery();
        query.setLevel(DpermitConsts.DEPT_LEVEL_ONE);
        query.setStatus(GlobalConsts.YES);
        return deptService.listByQuery(query);
    }

    /**
     * 获取二级部门
     *
     * @return the two dept list
     */
    protected List<McDept> getTwoDeptList() {
        McDeptQuery query = new McDeptQuery();
        query.setLevel(DpermitConsts.DEPT_LEVEL_TWO);
        query.setStatus(GlobalConsts.YES);
        List<McDept> list = deptService.listByQuery(query);
        return list;
    }
}
